import {listProject} from "@/api/cmdb/project";

const project = {
  state: {
    projects: [],
    projectTotal: '',
  },

  mutations: {
    SET_PROJECT: (state, response) => {
      state.projects = response.data
      state.projectTotal = response.data.length
    },
  },

  actions: {
    /** 查询project列表列表 */
    GetProjectList({ commit ,state}) {
      listProject().then(response => {
        commit('SET_PROJECT',response)
      });
    },
  }
}

export default project
